1
کامپیوتر و شبکه::
room resource
You'll notice that this room resource doesn't contain the ID property
Now that we have model classes that represent a room in the data base, the room resource will return to the client, and also, we have test data in our data base.
It'll return a room resource, so we'll say action result, action result of room, and it's called get room by id, there we go, this'll take a room id, I want the route to this to be, get slash rooms, slash room id,
if we did find an entity, let's take that entity data, and put it into a room resource, say var resource equals new room, we'll need to import the model's name space, now, let's just build up these properties, Href is gonna be Url dot link, the route is this route, get room by id, and we need to add some route parameters, these are passed in an anonymous object like this, say room id which matches the name of the route parameter in the signature of this method, it comes from the entity dot id, and then the name comes from entity dot name, and the rate comes from entity dot rate, which if you remember is an in so we need to divide by one hundred point zero m, which make sure we do the casting to a decimal correctly.
In this case, we should grab an entity out of the data base, build up a new room resource, and return it to the client, so everything's working.
واژگان شبکه مترجمین ایران